Imports SchemaCodeGen

Partial Class pages_SchemaSnapshots_SchemaSnapshot : Inherits CPage

#Region "Querystring"
	Public ReadOnly Property SchemaId() As Integer
		Get
			Dim id As Integer = CWeb.RequestInt("schemaId")
			If id = Integer.MinValue Then CSitemap.RecordNotFound("SchemaSnapshot", id)
			Return id
		End Get
	End Property
#End Region

#Region "Members"
	Private m_schemaSnapshot As CSchemaSnapshot
#End Region

#Region "Data"
	Public ReadOnly Property [SchemaSnapshot]() As CSchemaSnapshot
		Get
			If IsNothing(m_schemaSnapshot) Then
				Try
					m_schemaSnapshot = New CSchemaSnapshot(SchemaId)
				Catch
					CSitemap.RecordNotFound("SchemaSnapshot", SchemaId)
				End Try
			End If
			Return m_schemaSnapshot
		End Get
	End Property
#End Region

#Region "Event Handlers - Page"
	Protected Overrides Sub PageLoad()
		With Me.SchemaSnapshot

			lnkSchemaConnectionId.Text = .Connection.ConnectionName
			lnkSchemaConnectionId.NavigateUrl = CSitemap.ConnectionEdit(.SchemaConnectionId)

			txtSchemaBinary.Text = CUtilities.FileSize(.BinarySize)
			txtSchemaMD5.Text = CBinary.ToBase64(.SchemaMD5)
			txtSchemaCreated.Text = CUtilities.Timespan(.SchemaCreated)
		End With
	End Sub
#End Region

End Class
